home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / macgzip_022-src / macos / Posix / ThinkCPosix Sources / pathconf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-26  |  519 b   |  23 lines  |  [TEXT/MPS ]

  1. /* $ld: $ */
  2.  
  3. #include <fcntl.h>
  4. #include "ThinkCPosix.h"
  5.  
  6. long pathconf(path, name)
  7. char *path;            /* name of file being interrogated */
  8. int name;            /* property being inspected */
  9. {
  10. /* POSIX allows some of the values in <limits.h> to be increased at
  11.  * run time.  The pathconf and fpathconf functions allow these values
  12.  * to be checked at run time. We do not use this facility.
  13.  */
  14.  
  15.   int fd;
  16.   long val;
  17.  
  18.   if ( (fd = open(path, O_RDONLY)) < 0) return(-1L);
  19.   val = fpathconf(fd, name);
  20.   close(fd);
  21.   return(val);
  22. }
  23.